<template>
  <div class="nav-bar">
    <div class="left">
      <div class="logo">
        <img src="/logo.png" alt="logo">
        <span>AI助手</span>
      </div>
    </div>
    <div class="center">
      <el-menu mode="horizontal" :ellipsis="false" router>
        <el-menu-item index="/chat">对话</el-menu-item>
        <el-menu-item index="/image">图像</el-menu-item>
        <el-menu-item index="/tools">工具</el-menu-item>
        <el-menu-item index="/market">市场</el-menu-item>
      </el-menu>
    </div>
    <div class="right">
      <el-space>
        <el-input
          v-model="searchText"
          placeholder="搜索..."
          prefix-icon="Search"
          class="search-input"
        />
        <el-dropdown>
          <el-avatar :size="32" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>个人中心</el-dropdown-item>
              <el-dropdown-item>设置</el-dropdown-item>
              <el-dropdown-item divided>退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </el-space>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'

const searchText = ref('')
</script>

<style scoped lang="scss">
.nav-bar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);

  .left {
    .logo {
      display: flex;
      align-items: center;
      gap: 10px;
      
      img {
        height: 32px;
      }
      
      span {
        font-size: 20px;
        font-weight: bold;
        color: #333;
      }
    }
  }

  .center {
    flex: 1;
    display: flex;
    justify-content: center;

    :deep(.el-menu) {
      border-bottom: none;
    }

    :deep(.el-menu-item) {
      font-size: 15px;
      height: 60px;
      line-height: 60px;
      
      &.is-active {
        font-weight: bold;
      }
    }
  }

  .right {
    .search-input {
      width: 200px;
      
      :deep(.el-input__wrapper) {
        border-radius: 20px;
      }
    }
  }
}
</style> 